<template>
    <div>
      <a-row type="flex" justify="space-around" align="middle" class="height-100">
        <a-col  :span="5" :order="4" v-for="item in indicesDatas" >
          <home-card :num="item.num" :name="item.name" :zdf="item.zdf"
            :curDate="item.curData"
          ></home-card>
        </a-col>

      </a-row>

      <a-row type="flex" justify="space-around" align="middle">
        <a-col span="12" v-for="item in lineData">
          <home-line :rows-data="item.dataItemVoList" :code="item.code" :line-title="item.title" ></home-line>
        </a-col>

      </a-row>

    </div>
</template>

<script>

  import homeCard from './securities/home/components/HomeCard';
  import {queryHomeLineData} from '../static/api/indices/index';
  import HomeLine from './securities/home/components/HomeLine';



  export default {
      name: "index",
      components:{
        homeCard,
        HomeLine
      },
      created(){
        this.queryLineData();  //查询线型图形所需数据
      },
      data(){
        return {
          // data,
          cardborder: true,
          //指数card
          indicesDatas: [
            {'name':'上证1','num':3099.90,'zdf':0.34,'curData':'2020-09-08'},
            {'name':'上证2','num':3099.90,'zdf':0.34,'curData':'2020-09-08'},
            {'name':'上证3','num':3099.90,'zdf':0.34,'curData':'2020-09-08'},
            {'name':'上证4','num':3099.90,'zdf':0.34,'curData':'2020-09-08'}
          ],
          lineData: undefined,
        }
      },
      methods:{
        queryLineData(){
          queryHomeLineData().then(req => {
            debugger
            this.lineData = req.data.data
            // this.lineData = [{"code":"000300","dataItemVoList":[{"tclose":3867.02,"tradedate":"2020-05-29"},{"tclose":3971.34,"tradedate":"2020-06-01"},{"tclose":3983.57,"tradedate":"2020-06-02"},{"tclose":3983.65,"tradedate":"2020-06-03"},{"tclose":3982.19,"tradedate":"2020-06-04"},{"tclose":4001.25,"tradedate":"2020-06-05"},{"tclose":4021.95,"tradedate":"2020-06-08"},{"tclose":4047.03,"tradedate":"2020-06-09"},{"tclose":4039.71,"tradedate":"2020-06-10"},{"tclose":3995.88,"tradedate":"2020-06-11"},{"tclose":4003.08,"tradedate":"2020-06-12"},{"tclose":3954.99,"tradedate":"2020-06-15"},{"tclose":4014.57,"tradedate":"2020-06-16"},{"tclose":4017.59,"tradedate":"2020-06-17"},{"tclose":4044.38,"tradedate":"2020-06-18"},{"tclose":4098.71,"tradedate":"2020-06-19"},{"tclose":4102.05,"tradedate":"2020-06-22"},{"tclose":4121.79,"tradedate":"2020-06-23"},{"tclose":4138.99,"tradedate":"2020-06-24"},{"tclose":4109.72,"tradedate":"2020-06-29"}],"title":"沪深300"},{"code":"000001","dataItemVoList":[{"tclose":2852.35,"tradedate":"2020-05-29"},{"tclose":2915.43,"tradedate":"2020-06-01"},{"tclose":2921.4,"tradedate":"2020-06-02"},{"tclose":2923.37,"tradedate":"2020-06-03"},{"tclose":2919.25,"tradedate":"2020-06-04"},{"tclose":2930.8,"tradedate":"2020-06-05"},{"tclose":2937.77,"tradedate":"2020-06-08"},{"tclose":2956.11,"tradedate":"2020-06-09"},{"tclose":2943.75,"tradedate":"2020-06-10"},{"tclose":2920.9,"tradedate":"2020-06-11"},{"tclose":2919.74,"tradedate":"2020-06-12"},{"tclose":2890.03,"tradedate":"2020-06-15"},{"tclose":2931.75,"tradedate":"2020-06-16"},{"tclose":2935.87,"tradedate":"2020-06-17"},{"tclose":2939.32,"tradedate":"2020-06-18"},{"tclose":2967.63,"tradedate":"2020-06-19"},{"tclose":2965.27,"tradedate":"2020-06-22"},{"tclose":2970.62,"tradedate":"2020-06-23"},{"tclose":2979.55,"tradedate":"2020-06-24"},{"tclose":2961.52,"tradedate":"2020-06-29"}],"title":"上证指数"},{"code":"000905","dataItemVoList":[{"tclose":5406.34,"tradedate":"2020-05-29"},{"tclose":5569.48,"tradedate":"2020-06-01"},{"tclose":5566.44,"tradedate":"2020-06-02"},{"tclose":5572.31,"tradedate":"2020-06-03"},{"tclose":5576.75,"tradedate":"2020-06-04"},{"tclose":5585.42,"tradedate":"2020-06-05"},{"tclose":5575.3,"tradedate":"2020-06-08"},{"tclose":5610.38,"tradedate":"2020-06-09"},{"tclose":5615.24,"tradedate":"2020-06-10"},{"tclose":5589.1,"tradedate":"2020-06-11"},{"tclose":5591.49,"tradedate":"2020-06-12"},{"tclose":5590.64,"tradedate":"2020-06-15"},{"tclose":5695.3,"tradedate":"2020-06-16"},{"tclose":5735.42,"tradedate":"2020-06-17"},{"tclose":5734.4,"tradedate":"2020-06-18"},{"tclose":5787.15,"tradedate":"2020-06-19"},{"tclose":5784.03,"tradedate":"2020-06-22"},{"tclose":5804.34,"tradedate":"2020-06-23"},{"tclose":5789.09,"tradedate":"2020-06-24"},{"tclose":5762.44,"tradedate":"2020-06-29"}],"title":"中证500"},{"code":"000016","dataItemVoList":[{"tclose":2806.66,"tradedate":"2020-05-29"},{"tclose":2870.36,"tradedate":"2020-06-01"},{"tclose":2885.92,"tradedate":"2020-06-02"},{"tclose":2889.11,"tradedate":"2020-06-03"},{"tclose":2883.36,"tradedate":"2020-06-04"},{"tclose":2896.35,"tradedate":"2020-06-05"},{"tclose":2909.59,"tradedate":"2020-06-08"},{"tclose":2928.3,"tradedate":"2020-06-09"},{"tclose":2908.48,"tradedate":"2020-06-10"},{"tclose":2876.51,"tradedate":"2020-06-11"},{"tclose":2884.12,"tradedate":"2020-06-12"},{"tclose":2838.61,"tradedate":"2020-06-15"},{"tclose":2878.99,"tradedate":"2020-06-16"},{"tclose":2881.13,"tradedate":"2020-06-17"},{"tclose":2888.96,"tradedate":"2020-06-18"},{"tclose":2925.94,"tradedate":"2020-06-19"},{"tclose":2921.89,"tradedate":"2020-06-22"},{"tclose":2925.42,"tradedate":"2020-06-23"},{"tclose":2943.47,"tradedate":"2020-06-24"},{"tclose":2925.48,"tradedate":"2020-06-29"}],"title":"中证50"}]
          })
        }


      }


  }
</script>

<style scoped>

  .ant-statistic-content > .ant-statistic-content-value>{
    font-size: 5px;
  }


</style>
